#include "tasks.h"

uint32_t task1_time = 250;
uint32_t task2_time = 1000;

uint32_t task1_time_counter = 0;
uint32_t task2_time_counter = 0;

uint8_t task1_time_flag = 0;
uint8_t task2_time_flag = 0;


void systick_isr(void)
{
    if (task1_time_counter == task1_time)
    {
        task1_time_flag = 1;
        task1_time_counter = 0;
    }else 
        task1_time_counter++;
    
    if (task2_time_counter== task2_time)
    {
        task2_time_flag = 1;
        task2_time_counter= 0;
    }else 
        task2_time_counter++;
}

void systick_tasks(void)
{
    if (task1_time_flag)
    {
        TOGGLE_LED1();
        task1_time_flag = 0;
    }
        
    if (task2_time_flag)
    {
        TOGGLE_LED2();
        task2_time_flag = 0;
    }
}

